<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>HouDun许愿墙</title>
	<link rel="stylesheet" href="./Css/index.css" />
	<script type="text/javascript" src='./Js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript" src='./Js/index.js'></script>
</head>
<body>
      <?php if ($login):?>
        <?php echo $userinfo['username']; ?>您好！<a href="login.php" action=logout''>注销</a>
        <?php else: ?>
        您还没有登录，请先<a href="login.php">登录</a>！
        <?php endif; ?>
          <h2>一共有<?php echo $total;?>条留言</h2>
          <form action="" method="get">
                  <input type="text" placeholder="请输入搜索关键字" name="search" value="<?php echo $search; ?>">
                  <input type="submit" value="提交">
                  </form>
	<div id='top'>
		<span id='send'></span>
	</div>
        
        
      
	<div id='main'>
             <?php
                        foreach($wishlist as $row)
                        {
                        ?>
            <dl class='paper a<?php echo rand(1, 5) ?>'>
                   
			<dt>
                           
				<span class='username'><?php echo $row["username"]; ?></span>
				<span class='num'><?php echo $row["id"]; ?></span>
			</dt>
			<dd class='content'><?php echo $row["content"]; ?></dd>
			<dd class='bottom'>
				<span class='time'><?php echo $row["time"]; ?></span>
			<a href="javascript:" onclick="if(confirm('确定删除吗？')) location.href='Del.php?id=<?php echo $row['id']?>'" class='close'></a>
                                
                              <a href="update.php? id=<?php echo $row['id']?>" id='send'style="width:50px;height:30px;"></a> 
                                
			</dd>     
		</dl>
		 <?php
                        }
                        ?>    
	</div>

        
        
        <ul id="page">
                            <?php
                            $pre=(($page-1)<=0)?1:($page-1);
                            $next=(($page+1)>$maxpage)?$maxpage:($page+1);
                            ?>
                            <li><a href="index.php?page=1">首页</a></li>
                            <li><a href="index.php?page=<?php echo $pre;?>">上一页</a></li>
                            <li><a href="index.php?page=<?php echo $next;?>">下一页</a></li>
                            <li><a href="index.php?page=<?php echo $maxpage;?>">末页</a></li>
                            <li><?php echo "共".$maxpage."页当前".$page."页";?></li>
                        </ul>
	<div id='send-form'>
		<p class='title'><span>许下你的愿望</span><a href="" id='close'></a></p>
                <form action="empadd.php" name='wish' >
			<p>
				<label for="username">昵称：</label>
				<input type="text" name='username' id='username'/>
			</p>
			<p>
				<label for="content">愿望：(您还可以输入&nbsp;<span id='font-num'>50</span>&nbsp;个字)</label>
				<textarea name="content" id='content'></textarea>
				<div id='phiz'>
					<img src="./Images/phiz/zhuakuang.gif" alt="抓狂" />
					<img src="./Images/phiz/baobao.gif" alt="抱抱" />
					<img src="./Images/phiz/haixiu.gif" alt="害羞" />
					<img src="./Images/phiz/ku.gif" alt="酷" />
					<img src="./Images/phiz/xixi.gif" alt="嘻嘻" />
					<img src="./Images/phiz/taikaixin.gif" alt="太开心" />
					<img src="./Images/phiz/touxiao.gif" alt="偷笑" />
					<img src="./Images/phiz/qian.gif" alt="钱" />
					<img src="./Images/phiz/huaxin.gif" alt="花心" />
					<img src="./Images/phiz/jiyan.gif" alt="挤眼" />
				</div>
			</p>
                        <p><input class="btn" type="submit" value="" id='send-btn' style="border:0; width: 134px;height: 54px"/>
                          
                        </p>
		</form>
	</div>
          
          
  
</body>
</html>